import axios from 'axios';

const http = axios.create({
    baseURL: import.meta.env.VITE_API_BASE_URL,
    timeout: 10000,
});

// ... 其他配置 ...

// 添加文件上传方法
http.uploadFile = async (url: string, formData: FormData) => {
    try {
        const response = await http.post(url, formData, {
            headers: {
                'Content-Type': 'multipart/form-data',
            },
        });
        return response.data;
    } catch (error) {
        throw error;
    }
};

export default http; 